package com.example.firstday.kotlin
fun main() {
    println("hello world")
    println(add(1,2))
    println(add2(1,2))
    add3("张三")
    add3("李四","深圳")
    add4("my is tom","I is ok","second","three","four")
}
//基本函数
fun add( a:Int,b:Int) : Int{
   return a+b
}
//函数表达
fun add2(a:Int,b:Int) = a+b
//默认函数
fun add3(name:String , city:String = "上海"){
    println("我叫$name,来自$city")
}
//可变参数
fun add4(info: String,vararg msg:String){
    println("info的内容为:$info")
    for (m in msg) println(m)
}